//
//  MKAPIServiceBase.h
//  MKAPI
//
//  Created by 苏尚进 on 2023/5/15.
//  Copyright © 2023 moon. All rights reserved.
//

#import "MKAPIHttpHeaders.h"

NS_ASSUME_NONNULL_BEGIN

typedef void(^MKAPIServiceRequestBlock)(__kindof MKAPIHttpRequestBase * _Nullable requestTask,BOOL success,NSError * _Nullable error);

@interface MKAPIServiceBase : MKAPITask

/// 发送指定的网络请求，同时在debug模式下，会输出请求的发送和接收日志
/// - Parameters:
///   - request: 网络请求对象
///   - completion: 完成回调
- (void)sendRequest:(MKAPIHttpRequestBase *)request withCompletion:(nullable MKAPIServiceRequestBlock)completion;

//日志输出
- (NSString *)requestDescriptionWithRequest:(nullable __kindof MKAPIHttpRequestBase *)request requestParam:(nullable __kindof MKAPIRequestParam *)requestParam;
- (NSString *)responseDescription:(MKAPIHttpRequestBase *)request requestParam:(MKAPIRequestParam *)requestParam respondData:(id)responseData error:(NSError *)error;
@end

NS_ASSUME_NONNULL_END
